#:kivy 1.6.0
#:import DisableableButton ui.disableable_button.DisableableButton
#:import NumInput ui.num_input.NumInput
#:import FittableButton ui.fittable_widgets.FittableButton
#:import FittableLabel ui.fittable_widgets.FittableLabel
#:import TextInput ui.fittable_widgets.FittableTextInput

<Join>:
    game_id: game_id
    pin_code: pin_code
    next_button: next_button
    orientation: 'vertical'
    BoxLayout:
        orientation: 'horizontal'
        size_hint_y: None
        height: root.height*0.1
        DisableableButton:
            id: next_button
            color_name: 'green'
            text: _('Next')
            on_release: root.go_next()
    BoxLayout:
        size_hint_y: None
        height: root.height*0.1
        Label:
            text: _('Game Id')
        NumInput:
            id: game_id
            font_size: 0.6 * self.height
            multiline: False
            on_text: root.check_id()
            presenter: root.presenter
            on_text_validate: root.pin_code.focus = True
    BoxLayout:
        size_hint_y: None
        height: root.height*0.1
        Label:
            text: _('Pin number')
        NumInput:
            id: pin_code
            font_size: 0.6 * self.height
            multiline: False
            on_text: root.check_pin()
            presenter: root.presenter
            on_text_validate: root.pin_code.focus = True
            password: True
            on_text_validate: root.try_go_next()
    Label:

<ErrorPopup>:
    size_hint: 0.5, 0.3
    FittableButton:
        text: _('Ok')
        on_release: root.dismiss()
